import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SignInVO, SignInForm, SignInQuery } from '@/api/primary/signIn/types';

/**
 * 查询会员签到列表
 * @param query
 * @returns {*}
 */

export const listSignIn = (query?: SignInQuery): AxiosPromise<SignInVO[]> => {
  return request({
    url: '/primary/signIn/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询会员签到详细
 * @param id
 */
export const getSignIn = (id: string | number): AxiosPromise<SignInVO> => {
  return request({
    url: '/primary/signIn/' + id,
    method: 'get'
  });
};

/**
 * 新增会员签到
 * @param data
 */
export const addSignIn = (data: SignInForm) => {
  return request({
    url: '/primary/signIn',
    method: 'post',
    data: data
  });
};

/**
 * 修改会员签到
 * @param data
 */
export const updateSignIn = (data: SignInForm) => {
  return request({
    url: '/primary/signIn',
    method: 'put',
    data: data
  });
};

/**
 * 删除会员签到
 * @param id
 */
export const delSignIn = (id: string | number | Array<string | number>) => {
  return request({
    url: '/primary/signIn/' + id,
    method: 'delete'
  });
};
